﻿using System.Windows;
using System.Windows.Controls;
using TeBigScreenWpf.ViewModels;

namespace TeBigScreenWpf.Pages
{
    /// <summary>
    /// Interaction logic for Page4.xaml
    /// </summary>
    public partial class Page4 : Page
    {
        public Page4()
        {
            InitializeComponent();

            DataContext = vmGlobal.vmPage.Value;

            this.Loaded += Page_Loaded;
        }

        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            RestoreMapZoom();

            //Media.Stretch = Stretch.Fill;
            //Media.Source = new Uri( "rtsp://192.168.1.128:554/cam/realmonitor?channel=2&subtype=0&unicast=true&proto=Onvif");
        }

        private void RestoreMapZoom()
        {
            var rect = new Rect(122.522972217755, 45.4248047848192, 3.66945357079578, 1.89817313630427);

            this.GeoMap.ZoomToGeographic(rect);
        }
    }
}